<script setup lang="ts">

import { ref } from 'vue'
import axios from 'axios';

// import TheWelcome from '../components/TheWelcome.vue'
import Header from '../components/common/Header.vue'
import Lunbo from '../components/common/Lunbo.vue'

import YyjkHomeHangye from '../components/yyjk/home/Hangye.vue'
import YyjkHomeChanpin from '../components/yyjk/home/Chanpin.vue'
import YyjkFooter from '../components/yyjk/common/Footer.vue'
import YyjkHome from './YyjkView.vue'
import DIY from './DIY.vue'


// import { GridLayout, GridItem } from "vue-grid-layout"
const VITE_URL = window.VITE_URL;
const VITE_UNIACID = window.VITE_UNIACID;
const block = ref([
    // { "x": 0, "y": 0, "w": 2.5, "h": 2, "i": "0" },
    // { "x": 2, "y": 0, "w": 2, "h": 4, "i": "1" },
    // { "x": 4, "y": 0, "w": 2, "h": 5, "i": "2" },
    // { "x": 6, "y": 0, "w": 2, "h": 3, "i": "3" }
])
const has_home_diy = ref(1)
// todo 查看是否 有PC端设为首页的 DIY页面，
const get_home_diy = () => {


	const url = VITE_URL + '/pc/diy/home'+ '?i=' + VITE_UNIACID;

	axios.get(url).then((res: any) => {

		if( res.data ){
			block.value = res.data.diy;
			has_home_diy.value = 1
		}else{
			has_home_diy.value = 0
		}
		// has_home_diy.value = 0
	});

}
get_home_diy();

</script>
<template>

	<template v-if="has_home_diy==1">

		<DIY></DIY>

	</template>

	<template v-if="has_home_diy==0">
		<!-- has_home_diy{{ has_home_diy }} -->
		<YyjkHome></YyjkHome>

	</template>

</template>
